import unittest
from hrim_add_temp.api.hrim_addtemp_shell import AddTemp
from hrim_add_temp.common.delete_tel import DEBUTI
from hrim_add_temp.common.hrim_assert import hrim_assret
from hrim_add_temp.data import read_data
from parameterized import parameterized


class TestAdd(unittest.TestCase):
    def setUp(self):
        DEBUTI.delte("")
    def tearDown(self):
        DEBUTI.delte("")
    @parameterized.expand(read_data)
    def test01_add(self,dess,json_data,status_code,success,code,message):
        head = {"Content-Type": "application/json",
                "Authorization": "Bearer 79d526b1-212f-489a-8448-65a8db7df855"}

        resp = AddTemp.add_temp(head, json_data)
        print(dess,resp.json())
        hrim_assret(self,resp,status_code,success,code,"message")

    # def test02_add(self):
    #     head = {"Content-Type": "application/json",
    #             "Authorization": "Bearer 79d526b1-212f-489a-8448-65a8db7df855"}
    #     json_data = {
    #         "username": "小猪佩奇",
    #         "mobile": "19152662336",
    #         "workNumber": "9527",
    #         "formOfEmployment": "2"}
    #     resp = AddTemp.add_temp(head, json_data)
    #     print(resp.json())
    #
    #     hrim_assret(self,resp,200,True,10000,"操作成功")
    #
    # def test03_add(self):
    #     head = {"Content-Type": "application/json",
    #             "Authorization": "Bearer 79d526b1-212f-489a-8448-65a8db7df855"}
    #     json_data = {"username": "大猪乔治",
    #                  "mobile": "15354463457",
    #                  "timeOfEntry": "2021-12-01",
    #                  "formOfEmployment": 1,
    #                  "workNumber": "777888",
    #                  "departmentName": "测试",
    #                  "departmentId": "1452603344685203456",
    #                  "correctionTime": "2021-12-30T16:00:00.000Z"}
    #     resp = AddTemp.add_temp(head, json_data)
    #     print(resp.json())
    #     hrim_assret(self,resp,200,True,10000,"操作成功")
